package com.enjoy.rpc.sms;

import com.enjoy.rpc.base.RpcServiceFrame;
import com.enjoy.rpc.remote.SendSms;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.io.IOException;

@Service
public class SmsRpcServer {
    @Autowired
    private RpcServiceFrame rpcServiceFrame;

    @PostConstruct
    public void server() throws IOException {
        int port = 8778;
        this.rpcServiceFrame.startService(SendSms.class.getName(), port, SendSmsImpl.class);
    }
}
